#!/usr/bin/python
# -*- coding: utf-8 -*-

#This file is part of pyLot library.
#
# pyLot is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# pyLot is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with pyLot.  If not, see <http://www.gnu.org/licenses/>.

__author__ = u'Guillaume Baty'
__copyright__ = u"Copyright 2011-2012 (C) andheo"
__credits__ = [u'Guillaume Baty']
__license__ = "GNU Lesser General Public License"

u"""
pyLot widget interface.
  - 03-2010, Pierre Puiseux, Guillaume Baty
  
Université de Pau et des Pays de l'Adour, INRIA
"""

__all__ = [u'ITypedSelector']

from Qt4 import QtGui
from traits.api import Interface, Unicode, Python

from ..interfaces.i_widget import IWidget
from _pylot.qtgui.custom import DEFAULT_CUSTOM

class ITypedSelector (Interface):

  nature = Python

  def __init__(self, datum, custom=DEFAULT_CUSTOM):
    u"""

    A GuiSelector emits a "valueChanged" signal when value changes.

    Example :
    
    class MySelector(MyWidget):
    
      implements(IGuiSelector)
      valueChanged = QtCore.Signal(object)

      def __init__(self, datum, datarange=(0, 1000000), custom=DEFAULT_CUSTOM):
        MyWidget.__init__(self)
        self.myWidgetValueChangedSignal.connect(self._valueChanged)
  
      def _valueChanged(value):
        valueChanged.emit(value)

    """

  def value(self):
    u"""
    return current value 
    """

  def getValue(self):
    u"""
    value alias
    """

  def setValue(self, value):
    u"""
    """

  def setDefaultValue(self, value):
    u"""
    """

  def setValueList(self, value_list):
    u"""
    """

  def setState(self, state, msg=u''):
    u"""
    Set state to widget    
    state : None (doubt), True (ok), False (not valid)
    """

if  __name__ == u"__main__":
  pass
